Getting Intermittent SecurityException "Request for the permission of type 'System.Security.Permissions.Secur ityPermission, mscorlib...' failed"
We are running a SharePoint website (MOSS 2007) on a farm (3 FE) using a Cutom Trust Level.
When we are using SharePoint Search, sometimes we get our results and sometimes we get a SecurityException (on exactly the same queries)... Once we are getting this exception, all the queries returns SecurityException since we recycle the AppPool.
I don't understand why this exception occured... I think about a bad configuration of our Trust Level but it seems to be correctly set and it doesn't explain the "Intermittent" side of this exception...
Here is the stack trace:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration
file.
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration
file.
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
<CrtImplementationDetails>.RegisterModuleUninitializer(EventHandler ) +0
<CrtImplementationDetails>.LanguageSupport._Initialize(LanguageSupport* ) +984
<CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* ) +172
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3620; ASP.NET Version:2.0.50727.3618
July 5th, 2011 6:28am


